package com.wlb;

import org.springframework.messaging.simp.stomp.StompFrameHandler;
import org.springframework.messaging.simp.stomp.StompHeaders;
import org.springframework.messaging.simp.stomp.StompSession;
import org.springframework.messaging.simp.stomp.StompSessionHandlerAdapter;

import java.lang.reflect.Type;

/**
 * Created by yudi on 2017/8/8.
 */
public class MyStompSessionHandler extends StompSessionHandlerAdapter {
    @Override
    public void afterConnected(StompSession session, StompHeaders connectedHeaders) {
        System.out.println("sssss");
        session.subscribe("/topic/notification", new StompFrameHandler() {


            public Type getPayloadType(StompHeaders stompHeaders) {
                return String.class;
            }

            public void handleFrame(StompHeaders stompHeaders, Object o) {

            }
        });
    }
}
